/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.ibrae.mchs.radiation.entities;

import java.io.Serializable;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 *
 * @author murr
 */
@Entity
@Table(name = "subject_rf", uniqueConstraints = {
    @UniqueConstraint(columnNames = {"ID"})})
@NamedQueries({
    @NamedQuery(name = "SubjectRf.findAll", query = "SELECT s FROM SubjectRf s"),
    @NamedQuery(name = "SubjectRf.findById", query = "SELECT s FROM SubjectRf s WHERE s.id = :id"),
    @NamedQuery(name = "SubjectRf.findByName1", query = "SELECT s FROM SubjectRf s WHERE s.name1 = :name1")})
public class SubjectRf implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID", nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(name = "NAME1", nullable = false, length = 31)
    private String name1;
    @OneToMany(mappedBy = "subjectRf")
    private Set<Result> resultSet;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "subjectRf")
    private Set<Rajon> rajonSet;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "subjectRf")
    private Set<Selsovet> selsovetSet;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "subjectRf")
    private Set<RajonOld> rajonOldSet;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "subjectRf")
    private Set<GSPos> gSPosSet;
    @OneToMany(mappedBy = "subjectRf")
    private Set<Geoobject> geoobjectSet;

    public SubjectRf() {
    }

    public SubjectRf(Integer id) {
        this.id = id;
    }

    public SubjectRf(Integer id, String name1) {
        this.id = id;
        this.name1 = name1;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName1() {
        return name1;
    }

    public void setName1(String name1) {
        this.name1 = name1;
    }

    public Set<Result> getResultSet() {
        return resultSet;
    }

    public void setResultSet(Set<Result> resultSet) {
        this.resultSet = resultSet;
    }

    public Set<Rajon> getRajonSet() {
        return rajonSet;
    }

    public void setRajonSet(Set<Rajon> rajonSet) {
        this.rajonSet = rajonSet;
    }

    public Set<Selsovet> getSelsovetSet() {
        return selsovetSet;
    }

    public void setSelsovetSet(Set<Selsovet> selsovetSet) {
        this.selsovetSet = selsovetSet;
    }

    public Set<RajonOld> getRajonOldSet() {
        return rajonOldSet;
    }

    public void setRajonOldSet(Set<RajonOld> rajonOldSet) {
        this.rajonOldSet = rajonOldSet;
    }

    public Set<GSPos> getGSPosSet() {
        return gSPosSet;
    }

    public void setGSPosSet(Set<GSPos> gSPosSet) {
        this.gSPosSet = gSPosSet;
    }

    public Set<Geoobject> getGeoobjectSet() {
        return geoobjectSet;
    }

    public void setGeoobjectSet(Set<Geoobject> geoobjectSet) {
        this.geoobjectSet = geoobjectSet;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SubjectRf)) {
            return false;
        }
        SubjectRf other = (SubjectRf) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "JPAtest.entities.SubjectRf[id=" + id + "]";
    }
}
